Vert.x in Action by Julien Ponge
Author:Julien Ponge [Ponge, Julien]
Language: eng
Format: epub, pdf
Publisher: Manning Publications Co.
Published: 0101-01-01T00:00:00+00:00
7.4.8 Dashboard web application
The dashboard web application offers live updates on the incoming updates throughput, city trends, and public user ranking. As seen in figure 7.14, the service consumes Kafka records emitted by the event stats service and regularly pushes updates to the web application.
Figure 7.14 Dashboard web application
The web application is written using the Vue.JS framework, just like the user web application described earlier. The frontend and backend are connected using the Vert.x event bus, so both the Vert.x and Vue.JS code bases can communicate with the same programming model.
Throughput and city trend updates from Kafka topics are directly forwarded over the Vert.x event bus, so the connected web application client receives the updates in real time. The backend maintains in-memory data about the number of steps over the last 24 hours for all users who have made their profile public. The ranking is updated every 5 seconds, and the result is pushed to the web application over the event bus so that the ranking is updated in the connected web browsers.
Since the backend is event-driven over Kafka topics, a good question is what happens when the service starts (or when it recovers from a crash). Indeed, on a fresh start we do not have all the step data from the last 24 hours, and we will only receive updates from the serviceâs start time.
We need a hydration phase when the service starts, where we query the activity service and get the rankings over the last 24 hours. We then need to query the user profile service for each entry of the ranking, since we need to correlate each device with a user profile. This is a potentially costly operation, but it shouldnât happen very often.
Note that waiting for the hydration to complete does not prevent the processing of user activity updates, as eventually only the most recent value from either a Kafka record or the hydration data will prevail when updating the in-memory data.
The dashboard web application service is meant to be publicly exposed. It can be scaled to multiple instances if need be, and it can be put behind an HTTP proxy load balancer.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(25282)
Hello! Python by Anthony Briggs(24335)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(23421)
Kotlin in Action by Dmitry Jemerov(22504)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(21961)
Dependency Injection in .NET by Mark Seemann(21838)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(20707)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(19517)
Grails in Action by Glen Smith Peter Ledbrook(18595)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17031)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(15836)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(13684)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11851)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11151)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10621)
Hit Refresh by Satya Nadella(9188)
The Kubernetes Operator Framework Book by Michael Dame(8563)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8400)
Robo-Advisor with Python by Aki Ranin(8358)